<script language="javascript" type="text/javascript" src="p_ebd/valida_form.js"></script>
<script language="javascript" type="text/javascript" src="p_usuario/ajax_membro.js"></script>
<?php 
	$user = $_SESSION['usuario'];
	include "p_usuario/valida_credenciais.php";
	$valCr = new valida_credenciais();
	
	$nivel = array(1,2,4);
	if(!($valCr->validar($nivel))){
		header('Location: index.php?p=denied');
	}
?>
<div class="form">

	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h2>Matricular Membro na Escola Bíblica Dominical</h2>
			</div>
		</div>
	</div>
	<div class="row">
	<div class="col-md-3">
			<div class="actions">
				<div class="panel panel-default">
					<div class="panel-heading"><h5>Op&ccedil&otildees</h5></div>
						<div class="panel-body">
							<ul class="nav nav-pills nav-stacked">
								<li><a href="index.php?p=alunos" >Lista de Alunos</a></li>
								<li><a href="index.php?p=ebd">Lista de EBD's</a></li>
								<li><a href="index.php?p=classes">Classes</a></li>
							</ul>
						</div><!-- end body -->
				</div><!-- end panel -->
				</div>			
		</div><!-- end col md 3 -->
		<div class="col-md-9">
		<!-- HEAD DE FORMULÃ�RIO -->
		<div class="panel panel-default">
			<div class="panel-heading"><h5>Formul&aacuterio de Matr&iacutecula</h5></div>
			<div class="panel-body">
			<!-- FORMULÃ�RIO -->
			<form  method="post" name="form1" action="p_ebd/salvar_matricula.php">
				<div class="row">
					<div class="form-group col-md-6">
						<label for="nome">Membro (<span class="text-danger">*</span>)</label>
    					<div class="input-group">
	    					<input type="text" class="form-control " name="txtnome" id="txtnome" placeholder="pesquisar membro.."> 
	    					<span class="input-group-btn">
	              				<button type="button" class="btn btn-default" name="btnPesquisar"  onclick="getDados();" >Pesquisar</button>
							</span>
						</div>
					</div>
					<div class="form-group col-md-6">
						<label for="nome">Resultado da Consulta</label>
						<div id="Resultado" ></div>
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-6">
						<label for="classe">Classe ou Sala (<span class="text-danger">*</span>)</label>
    					<select name="classe" id="classe" class="form-control">
		          			<option value="selecione">Selecione...</option>
		          			<?php
									//require "banco/ConexaoBanco.php";
									$query = mysql_query("SELECT classes_ebd.id, classes_ebd.classe, ebd.nome_ebd FROM classes_ebd, ebd WHERE classes_ebd.ebd_id = ebd.id");
									while($lista = mysql_fetch_array($query)) { ?> 
									<option value="<?php echo $lista['id']; ?>"><?php echo $lista['classe'] . ' - ' . $lista['nome_ebd']; ?></option>
								<?php } mysql_close();?>
		          		</select>
		          	</div>
					
				</div>
				
				<div class="row">
					<div class="form-group col-md-2">
						<input type="submit" value="Matricular" class="btn btn-default " name="enviar" onclick="return valida_matricula()" >
					</div>
				</div>
			</form>
			</div>
		</div>

		</div><!-- end col md 12 -->
	</div><!-- end row -->
</div>
			